admin: Don't overwrite previous ref unless it's different
authorColin Walters <walters@verbum.org>
Thu, 24 Jan 2013 22:32:59 +0000 (17:32 -0500)
committerColin Walters <walters@verbum.org>
Thu, 24 Jan 2013 22:32:59 +0000 (17:32 -0500)
commit64934202e43ac6b067829078a79afb69c098dc45
tree95283515be529b516693ddaef37eff081093a8b5
parent59c98d0a0428826cf0e2f2cad57afd805e5f2285
admin: Don't overwrite previous ref unless it's different

We shouldn't overwrite deploy/<osname>/previous unless we actually
have something new.

This fixes the bug where two consecutive:

$ ostree admin upgrade foo
$ ostree admin upgrade foo

would end up pruning the data for foo/previous from the repo.
src/ostree/ot-admin-builtin-deploy.c